by Rob McGregor
In This Chapter
Modern Windows applications are chock full of gadgets and controls, including wizards. In an application context, as you know, a wizard walks the user through a series of simple steps to accomplish a complex task. This chapter explains the process of creating a basic wizard and the relationship of wizards to property sheets and property pages.
Property sheets, also known as tabbed dialog boxes, are commonly used in modern Windows applications. A property sheet is a special type of dialog box usually used to modify the properties of some external object. A property sheet has three main parts:
Property sheets are generally used when you have a number of related settings or options to change; they allow a large amount of information from multiple dialog boxes to be grouped within a single dialog box. For example, Windows uses a property sheet with various property pages to enable a user to change screen savers, wallpaper, video display modes, user interface attributes, colors, and so on.
MFC provides property sheets and property pages in the CPropertySheet and CPropertyPage classes. Lets take a quick look at these classes.
CPropertySheet objects represent property sheets, and even though CPropertySheet is derived directly from CWnd (and not from CDialog), managing a CPropertySheet object is similar to managing a CDialog object. The methods provided by the CPropertySheet class are listed in Table 34.1.
| Method | Description |
|---|---|
| AddPage() | Adds a page to the property sheet |
| Construct() | Constructs a CPropertySheet object |
| Create() | Displays a modeless property sheet |
| DoModal() | Displays a modal property sheet |
| EndDialog() | Terminates the property sheet |
| GetActiveIndex() | Gets the index of the active page of the property sheet |
| GetActivePage() | Returns the active page object |
| GetPage() | Gets a pointer to the specified page |
| GetPageCount() | Gets the number of pages in the property sheet |
| GetPageIndex() | Gets the index of the specified page of the property sheet |
| GetTabControl() | Gets a pointer to a tab control |
| PressButton() | Simulates the choice of the specified button in a property sheet |
| RemovePage() | Removes a page from the property sheet |
| SetActivePage() | Programmatically sets the active page object |
| SetFinishText() | Sets the text for the Finish button |
| SetTitle() | Sets the caption of the property sheet |
| SetWizardButtons() | Enables wizard buttons for a property sheet |
| SetWizardMode() | Enables wizard mode for a property sheet |